<template>
  <div class="goods-info">
    <h2>商品相关信息</h2>
    <div>
      <div>
        商品id: <strong>{{ goodInfo.goodNo }}</strong>
      </div>
      <div>
        商品名称: <strong>{{ goodInfo.goodName }}</strong>
      </div>
      <div>
        商品描述:
        <slot name="desc">
          <div v-if="goodInfo.type === 0" class="desc-text">
            {{ goodInfo.desc }}
          </div>
          <img v-else :src="goodInfo.desc" alt="" style="width: 120px" />
        </slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GoodsInfo",
  props: {
    goodInfo: {
      type: Object,
      required: true,
    },
  },
};
</script>

<style></style>
